<style>
.division table th,.division table td {padding:5px;}
.division {line-height:21px;}
.division input {padding:2px}
</style>
<div class="tableform">
<div class="widgetconfig">
	<div class="division">
	<table width="100%" cellpadding="0" cellspacing="0">
         <tr>
			<th>客服板块是否显示：</th>
			<td><input type="radio" name="showkfbox" value="on"<{if $setting.showkfbox!="off"}> checked="checked"<{/if}>> 显示&nbsp;<input type="radio" name="showkfbox" value="off"<{if $setting.showkfbox=="off"}> checked="checked"<{/if}>> 不显示  (方便不需要的时候临时隐藏而不是删除)</td>
		 </tr>
     </table>
    </div>

	<div class="clearfix">
    	<{button label=$___b2c="添加QQ在线客服"|t:'b2c' app="desktop" icon="btn_add.gif" id="addtencent"}>
        <{button label=$___b2c="添加旺旺在线客服"|t:'b2c' app="desktop" icon="btn_add.gif" id="addtabobao"}>
        <{button label=$___b2c="添加企业QQ代码"|t:'b2c' app="desktop" icon="btn_add.gif" id="addqyqq"}>
    </div>    
    <div class="division" id="kffloor">
      <{foreach from=$setting.online item=item key=key}>
      	<{if $item.type=='qq'}>
		 <div class="configad" style="margin-top:5px;">
          <table width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #e3e3e3;">
            <tr>					
				  <th style="width:60px;">客服名称:</th>
				  <td><input type="text" style="width:80px" name="online[<{$item.i}>][title]" value="<{$item.title}>" /></td>
				  <th style="width:60px;">QQ号码:</th>
				  <td><input type="text" style="width:100px" name="online[<{$item.i}>][links]" value="<{$item.links}>" /></td>
                  <th style="width:60px;">服务时间:</th>
				  <td><input type="text" style="width:100px" name="online[<{$item.i}>][time]" value="<{$item.time}>" /></td>
				  <th style="width:20px;vertical-align:middle;text-align:center;"><span onclick="delLink(this);"><{img src="bundle/delecate.gif" style="cursor:pointer;" alt="删除" title="删除" app="desktop"}></span></th>
             </tr>
          </table>
          <input type="hidden" name="online[<{$item.i}>][i]" value="<{$item.i}>" />
		  <input type="hidden" name="online[<{$item.i}>][type]" value="<{$item.type}>" />
        </div>
       <{elseif $item.type=='qyqq'}>
       <div class="configad" style="margin-top:5px;">
          <table width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #e3e3e3;">
            <tr>					
				  <th style="width:60px;">客服名称:</th>
				  <td><input type="text" style="width:80px" name="online[<{$item.i}>][title]" value="<{$item.title}>" /></td>
				  <th style="width:60px;">企业QQ号码:</th>
				  <td><input type="text" style="width:100px" name="online[<{$item.i}>][links]" value="<{$item.links}>" /></td>
                  <th style="width:60px;">服务时间:</th>
				  <td><input type="text" style="width:100px" name="online[<{$item.i}>][time]" value="<{$item.time}>" /></td>
				  <th style="width:20px;vertical-align:middle;text-align:center;"><span onclick="delLink(this);"><{img src="bundle/delecate.gif" style="cursor:pointer;" alt="删除" title="删除" app="desktop"}></span></th>
             </tr>
          </table>
          <input type="hidden" name="online[<{$item.i}>][i]" value="<{$item.i}>" />
		  <input type="hidden" name="online[<{$item.i}>][type]" value="<{$item.type}>" />
        </div>
       <{else}>
       	  <div class="configad" style="margin-top:5px;">
          <table width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #e3e3e3;">
            <tr>					
				  <th style="width:60px;">客服名称:</th>
				  <td><input type="text" style="width:80px" name="online[<{$item.i}>][title]" value="<{$item.title}>" /></td>
				  <th style="width:60px;">旺旺号码:</th>
				  <td><input type="text" style="width:100px" name="online[<{$item.i}>][links]" value="<{$item.links}>" /></td>
                  <th style="width:60px;">服务时间:</th>
				  <td><input type="text" style="width:100px" name="online[<{$item.i}>][time]" value="<{$item.time}>" /></td>
				  <th style="width:20px;vertical-align:middle;text-align:center;"><span onclick="delLink(this);"><{img src="bundle/delecate.gif" style="cursor:pointer;" alt="删除" title="删除" app="desktop"}></span></th>
             </tr>
          </table>
          <input type="hidden" name="online[<{$item.i}>][i]" value="<{$item.i}>" />
		  <input type="hidden" name="online[<{$item.i}>][type]" value="<{$item.type}>" />
        </div>
       <{/if}>
	<{/foreach}>
	</div>
	<div class="division">
	<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<th>微信二维码：</th>
			<td><input type='text' name="erwma" id="erwma" value="<{$setting.erwma}>" style="width:400px;"><input type="button" value="上传图片" onclick="addPic($('erwma'))" /></td>
		</tr>
        <tr>
          <th width="20%">图片尺寸:</th>
          <td>宽
            <input type="text" style="width:100px" name=ad[<{$data.i}>][showwidth] value="<{$data.showwidth}>">px&nbsp;&nbsp;高
            <input type="text" style="width:100px" name=ad[<{$data.i}>][showheight] value="<{$data.showheight}>">px </td>
          <td></td>
        </tr>
        <tr>
			<th>企业QQ服代码：</th>
			<td><input type='text' name='qyqq_link' value="<{$setting.qyqq_link}>" style="width:400px;" /><br /> 提示：如果你使用企业QQ作为在线客服，请填写客服代码。企业QQ客服代码可在企业QQ的“在线图标”获得。普通QQ本处请留空</td>            
		</tr>
         <tr>
			<th>热线电话：</th>
			<td><input type='text' name='fwrx' value="<{$setting.fwrx}>" style="width:400px;" />  请填写您的服务电话</td>            
		</tr>
	</table>
	</div>
</div>
</div>
<script>
$('addtencent').addEvent('click',function(){
  var d=new Date();
  var i=d.getTime();
  $('kffloor').adopt(new Element('div').set('html','\
	<div class="configad" style="margin-top:5px;">\
       <table cellpadding="0" cellspacing="0" width="100%" style="border:1px solid #e3e3e3;">\
         <tr><th style="width:60px;">客服名称：</th><td><input type="text" style="width:80px" name="online['+i+'][title]"></td>\
		 <th style="width:60px;">QQ号码:</th><td><input type="text" style="width:100px" name="online['+i+'][links]"></td>\
		 <th style="width:60px;">服务时间:</th><td><input type="text" style="width:100px" name="online['+i+'][time]"></td>\
		 <td style="width:20px;vertical-align:middle;text-align:center;"><span onclick="delLink(this);"><{img src="bundle/delecate.gif" style="cursor:pointer;" alt="删除" title="删除" app="desktop"}></span></td></tr>\
	 </table>\
     <input type="hidden" name="online['+i+'][i]" value="'+i+'">\
	 <input type="hidden" name="online['+i+'][type]" value="qq">\
    </div>\
  ').getFirst());
});

$('addtabobao').addEvent('click',function(){
  var d=new Date();
  var i=d.getTime();
  $('kffloor').adopt(new Element('div').set('html','\
	<div class="configad" style="margin-top:5px;">\
       <table cellpadding="0" cellspacing="0" width="100%" style="border:1px solid #e3e3e3;">\
         <tr><th style="width:60px;">客服名称：</th><td><input type="text" style="width:80px" name="online['+i+'][title]"></td>\
		 <th style="width:60px;">旺旺号码:</th><td><input type="text" style="width:100px" name="online['+i+'][links]"></td>\
		 <th style="width:60px;">服务时间:</th><td><input type="text" style="width:100px" name="online['+i+'][time]"></td>\
		 <td style="width:20px;vertical-align:middle;text-align:center;"><span onclick="delLink(this);"><{img src="bundle/delecate.gif" style="cursor:pointer;" alt="删除" title="删除" app="desktop"}></span></td></tr>\
	 </table>\
     <input type="hidden" name="online['+i+'][i]" value="'+i+'">\
	 <input type="hidden" name="online['+i+'][type]" value="ww">\
    </div>\
  ').getFirst());
});
$('addqyqq').addEvent('click',function(){
  var d=new Date();
  var i=d.getTime();
  $('kffloor').adopt(new Element('div').set('html','\
	<div class="configad" style="margin-top:5px;">\
       <table cellpadding="0" cellspacing="0" width="100%" style="border:1px solid #e3e3e3;">\
         <tr><th style="width:60px;">客服名称：</th><td><input type="text" style="width:80px" name="online['+i+'][title]"></td>\
		 <th style="width:60px;">企业QQ号码:</th><td><input type="text" style="width:100px" name="online['+i+'][links]"></td>\
		 <th style="width:60px;">服务时间:</th><td><input type="text" style="width:100px" name="online['+i+'][time]"></td>\
		 <td style="width:20px;vertical-align:middle;text-align:center;"><span onclick="delLink(this);"><{img src="bundle/delecate.gif" style="cursor:pointer;" alt="删除" title="删除" app="desktop"}></span></td></tr>\
	 </table>\
     <input type="hidden" name="online['+i+'][i]" value="'+i+'">\
	 <input type="hidden" name="online['+i+'][type]" value="qyqq">\
    </div>\
  ').getFirst());
});

delLink=function(o){$(o).getParent('.configad').remove();}

function addPic(target){
	var url='index.php?app=desktop&act=alertpages&goto='+encodeURIComponent("index.php?app=image&ctl=admin_manage&act=image_broswer&type=big");
	Ex_Loader('modedialog',function(){
		return new imgDialog(url,{onCallback:function(image_id,image_src){
				$(target).value=image_src;
		}})	;
	});
}	
</script>